using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace whereIsTheDonutGame
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class House : Solid
    {
        public int x, z;
        donutGame game;
        Gate gate;
        BoundingBox bbox, bboxWand2, bboxWand3, bboxWand4, bboxDach;
        public List<Model> models;
        public Model wand1, wand2, wand3, wand4, wand5;
        public House(donutGame game, int x, int z)
        {
            models = new List<Model>();

            this.x = x;
            this.z = z;
            this.game = game;
            LoadContent();

            //  bbox = new BoundingBox(new Vector3(x - 25, game.terrain.Height[x,z] - 5, -z - 35), new Vector3(x + 35, game.terrain.Height[x,z] + 5, -z + 35));
            bbox = new BoundingBox(Vector3.Zero, Vector3.Zero);
        }

        public BoundingBox getBoundingBox()
        {
            return bbox;
        }

        public List<BoundingBox> getBoundingBoxes()
        {
            List<BoundingBox> boxes = new List<BoundingBox>();
            foreach (Model m in models)
            {
                boxes.Add(Stuff.CalculateBoundingBox(m, Matrix.CreateTranslation(new Vector3(x, game.terrain.Height[x, z], -z))));
            }
            return boxes;
        }
        protected void LoadContent()
        {
            wand1 = this.game.Content.Load<Model>("tuerWand1");
            models.Add(wand1);
            wand2 = this.game.Content.Load<Model>("linkewand");
            models.Add(wand2);
            wand3 = this.game.Content.Load<Model>("rueckwand");
            models.Add(wand3);
            wand4 = this.game.Content.Load<Model>("rechtewand");
            models.Add(wand4);
            wand5 = this.game.Content.Load<Model>("tuerWand2");
            models.Add(wand5);
        }

       


    }
}
